



/*************************************************
GetProvinceList
**************************************************/

if exists 
  (
      select * from dbo.sysobjects 
      where id = object_id(N'GetProvinceList') 
      and OBJECTPROPERTY(id, N'IsProcedure') = 1
  )
  drop procedure GetProvinceList
GO

create procedure GetProvinceList

as

  select 
      'ProvinceId' = [id]
      ,'ProvinceName' = [districtname]
   from [district] 
   where [parentid]=0 
   
GO

/*************************************************
GetAreaListByProvice
**************************************************/

if exists 
  (
      select * from dbo.sysobjects 
      where id = object_id(N'GetAreaListByProvice') 
      and OBJECTPROPERTY(id, N'IsProcedure') = 1
  )
  drop procedure GetAreaListByProvice
GO

create procedure GetAreaListByProvice
  @pid int
as

  select 
      'CityId' = [id]
      ,'CityName' = [districtname]
   from [district] 
   where [parentid]=@pid 
   
GO

